<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>选手管理</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style>
        body {margin:0;}

        ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            overflow: hidden;
            background-color: #333;
            position: fixed;
            top: 0;
            width: 100%;
        }

        li {
            float: left;
        }

        li a {
            display: block;
            color: white;
            text-align: center;
            padding: 14px 16px;
            text-decoration: none;
        }

        li a:hover:not(.active) {
            background-color: #111;
        }

        .active {
            background-color: #4CAF50;
        }
    </style>
</head>
<body>

<ul>
    <li><a href="#">比赛管理员端口</a></li>
    <li><a href="/CompetitionOs">比赛管理</a></li>
    <li><a href="/PlayerOs">选手管理</a></li>
    <li><a href="/showScore">投票统计</a></li>
    <li><a href="/LoginOut">退出系统</a></li>
</ul>
<div style="padding:20px;margin-top:30px;background-color:#1abc9c;height:1500px;">
    <table class="table table-dark">
        <thead>
        <h1>选手列表</h1>
        </thead>
        <tbody>
        <tr>
            <th scope="row">选手Id</th>
            <td colspan="2">选手姓名</td>
            <td>操作</td>
        </tr>
        <tr th:each="player:${players}">
            <th scope="row"  th:text="${player.getPlayerId()}"></th>
            <td colspan="2"  th:text="${player.getPlayerName()}"></td>
            <td>
                <a class="btn btn-danger" id="del" th:href="@{/delPlayer/{playerId}(playerId=${player.getPlayerId()})}" onClick="return confirm('确定删除?');">删除</a>
                <a class="btn btn-info" id="upd" th:href="@{/changePlayer/{playerId}(playerId=${player.getPlayerId()},playerName=${player.getPlayerName()})}">修改</a>
            </td>
        </tr>
        </tbody>
    </table>
    <a class="btn btn-warning" id="ins" th:href="@{/toPlayerInsert}" style="width: 500px;margin-left: 35%">新增选手</a>



</div>
</body>
</html>